package com.turing.post.organization.util;

import java.io.Serializable;
import java.math.BigInteger;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

/**
 * 凭证种类
 * 
 * @author wzd
 * 
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "VOUCHERBUSINESSBIND")
@IdClass(VoucherBusinessBind.class)
public class VoucherBusinessBind implements Serializable {
	/**
	 * 凭证ID
	 */
	private BigInteger voucherId;
	/**
	 * 业务类型
	 */
	private String businessType;

	/**
	 * 销售
	 */
	public static final String BusinessType_01 = "01";
	/**
	 * 充值
	 */
	public static final String BusinessType_02 = "02";
	/**
	 * 赎回
	 */
	public static final String BusinessType_03 = "03";
	/**
	 * 正式挂失
	 */
	public static final String BusinessType_04 = "04";
	/**
	 * 挂失换卡
	 */
	public static final String BusinessType_05 = "05";
	/**
	 * 换发新卡
	 */
	public static final String BusinessType_06 = "06";
	/**
	 * 卡延期
	 */
	public static final String BusinessType_07 = "07";
	/**
	 * 重置密码
	 */
	public static final String BusinessType_08 = "08";
	/**
	 * 变更卡种类
	 */
	public static final String BusinessType_09 = "09";
	/**
	 * 登记实名信息
	 */
	public static final String BusinessType_10 = "10";
	/**
	 * 卡特殊业务
	 */
	public static final String BusinessType_CardTrancaction = "11";
	/**
	 * 账户管理费
	 */
	public static final String BusinessType_60 = "60";
	/**
	 * 过期管理费
	 */
	public static final String BusinessType_61 = "61";

	public VoucherBusinessBind() {

	}

	@Id
	@Column(name = "VOUCHERID", nullable = false)
	public BigInteger getVoucherId() {
		return voucherId;
	}

	public void setVoucherId(BigInteger voucherId) {
		this.voucherId = voucherId;
	}

	@Id
	@Column(name = "businessType", nullable = false)
	public String getBusinessType() {
		return businessType;
	}

	public void setBusinessType(String businessType) {
		this.businessType = businessType;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime
				* result
				+ ((getBusinessType() == null) ? 0 : getBusinessType()
						.hashCode());
		result = prime * result
				+ ((getVoucherId() == null) ? 0 : getVoucherId().hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final VoucherBusinessBind other = (VoucherBusinessBind) obj;
		if (getBusinessType() == null) {
			if (other.getBusinessType() != null)
				return false;
		} else if (!getBusinessType().equals(other.getBusinessType()))
			return false;
		if (getVoucherId() == null) {
			if (other.getVoucherId() != null)
				return false;
		} else if (!getVoucherId().equals(other.getVoucherId()))
			return false;
		return true;
	}
}